Carbon


OpenCPort

Header: Quickdraw.h Carbon status: Unsupported

Allocates space for and initializes a color graphics port.

void OpenCPort (
    CGrafPtr port
);
port

A pointer to a CGrafPort structure.

DISCUSSION

The OpenCPort function is analogous to OpenPort, except that OpenCPort opens a CGrafPort structure instead of a GrafPort structure.

Normally, your application does not need to call this function. The OpenCPort function is called by the NewCWindow and GetNewCWindow functions, as well as by the Dialog Manager when the appropriate color resources are present.

The OpenCPort function allocates storage for all the structures in the CGrafPort structure, and then calls InitCPort to initialize them. The InitCPort function does not allocate a color table for the PixMap structure for the color graphics port; instead, InitCPort copies the handle to the current device’s CLUT into the PixMap structure. The initial values for the CGrafPort structure are:

SPECIAL CONSIDERATIONS

The OpenCPort function may move or purge memory blocks in the application heap; do not call this function at interrupt time.

AVAILABILITY

Not supported in Carbon. Not available in CarbonLib, but available when InterfaceLib 7.1 or later is installed. Exported by InterfaceLib 7.1 and later.

CARBON NOTES

Carbon applications should use CreateNewPort and DisposePort to open and close graphics ports.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)